package com.ujoku.domain.admin;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.labillusion.core.util.jsonFormat.SimpleDateTimeSerializer;

import java.util.Date;

/**
 * Created by Greg.Chen on 2015/3/11.
 */
public class Task {

    private int id;
    private String type;
    private String message;

    private String typeName;

    public String getTypeName() {
        if(this.getType().equalsIgnoreCase(TaskType.ORDER)){
                return "订单";
        }
        if(this.getType().equalsIgnoreCase(TaskType.REPURCHASE)){
            return "私人酒窖回购";
        }
        if(this.getType().equalsIgnoreCase(TaskType.WITHDRAW)){
            return "提现";
        }
        return typeName;
    }


    @JsonSerialize(using = SimpleDateTimeSerializer.class)
    private Date updateTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    private int status;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
